<template>
	<view class="all">
		<view class="select">
			<u-subsection :list="list" :current="curNow" @change="sectionChange" class='subsection'></u-subsection>
			<view class="com">
				<view v-if="curNow===0" class="0">
					<idle></idle>
				</view>
				<view v-if="curNow===1" class="1">
					<buy></buy>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import Idle from 'pages/new/idle'
	import Buy from 'pages/new/buy'
	export default {
		data() {
				return {
					list: [
										{
											name: '发布闲置'
										}, 
										{
											name: '发布求购'
										}
						
									],
									curNow: 0
				}
			},
			methods: {
				
				sectionChange(index) {
								this.curNow = index;
							}
			},
			components:{
				Buy,
				Idle,
				
			}
		}
</script>

<style lang="scss">
.all{
	margin: 10px 0;
}
</style>
